package com.fish.yssb.db.bean;

import io.realm.RealmObject;
import io.realm.annotations.PrimaryKey;

/**
 * Used 尺寸转换工具类（全）
 *
 * 1、支持的数据类型：
 * boolean, byte, short, int, long, float, double, String, Date and byte[]
 * 在Realm中byte, short, int, long最终都被映射成long类型
 *
 * 2、注解说明
 *
 * @PrimaryKey
 *
 * ①字段必须是String、 integer、byte、short、 int、long 以及它们的封装类Byte, Short, Integer, and Long
 *
 * ②使用了该注解之后可以使用copyToRealmOrUpdate()方法，通过主键查询它的对象，如果查询到了，则更新它，否则新建一个对象来代替。
 *
 * ③使用了该注解将默认设置（@index）注解
 *
 * ④使用了该注解之后，创建和更新数据将会慢一点，查询数据会快一点。
 *
 * @Required
 *
 * 数据不能为null
 *
 * @Ignore
 *
 * 忽略，即该字段不被存储到本地
 *
 * @Index
 *
 * 为这个字段添加一个搜索引擎，这将使插入数据变慢、数据增大，但是查询会变快。建议在需要优化读取性能的情况下使用。
 */
public class BaseInfoTable extends RealmObject {



    //主键
    @PrimaryKey
    private int id;
    //排序变化
    private int idSort;

    //参数分类
    private int paraType;  //1 遥信 2遥测 3遥脉 4遥控 5 参数设定

    //名称
    private String name;

    //通信地址（16进制）
    private String connAdr;

    //单位
    private String unit;

    //数据类型
    private int  dataType; // 0.无 1.布尔 2.浮点 3.整形

    //默认值
    private String defualtVal;


    //实时数据
    private String realVal;

    //是否修改
    private String isChange_str;

    //是否修改
    private Boolean isChange;

    //预留值1
    private String reserve_str1;

    //预留值2
    private String reserve_str2;

    //预留值3
    private String reserve_str3;

    //预留值4
    private boolean reserve_str4;

    //预留值5
    private boolean reserve_str5;

    //预留值6
    private int reserve_str6;

    //预留值7
    private int reserve_str7;



    public BaseInfoTable() {
    }



    public BaseInfoTable(int idSort,int paraType,String name,String connAdr,
                         String unit,int dataType,String defualtVal,String isChange_str,Boolean isChange
    ) {
        this.idSort = idSort;
        this.paraType =paraType;
        this.name =name;
        this.connAdr = connAdr;
        this.unit = unit;
        this.dataType = dataType;
        this.defualtVal = defualtVal;
        this.isChange_str = isChange_str;
        this.isChange = isChange;
        this.id = idSort;
    }

    public BaseInfoTable(int idSort,int paraType,String name,String connAdr,
                         String unit,int dataType,String defualtVal,String isChange_str,Boolean isChange,
                         String reserve_str1, String reserve_str2,String reserve_str3,
                         boolean reserve_str4,boolean reserve_str5,int reserve_str6,int reserve_str7) {
        this.idSort = idSort;
        this.paraType =paraType;
        this.name =name;
        this.connAdr = connAdr;
        this.unit = unit;
        this.dataType = dataType;
        this.defualtVal = defualtVal;
        this.isChange_str = isChange_str;
        this.isChange = isChange;
        this.id = idSort;
    }

    public int getIdSort() {
        return idSort;
    }

    public void setIdSort(int idSort) {
        this.id =idSort;
        this.idSort = idSort;
    }

    public int getParaType() {
        return paraType;
    }

    public void setParaType(int paraType) {
        this.paraType = paraType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getConnAdr() {
        return connAdr;
    }

    public void setConnAdr(String connAdr) {
        this.connAdr = connAdr;
    }

    public String getUnit() {
        return unit;
    }

    public void setUnit(String unit) {
        this.unit = unit;
    }

    public int getDataType() {
        return dataType;
    }

    public void setDataType(int dataType) {
        this.dataType = dataType;
    }

    public String getDefualtVal() {
        return defualtVal;
    }

    public void setDefualtVal(String defualtVal) {
        this.defualtVal = defualtVal;
    }

    public String getIsChange_str() {
        return isChange_str;
    }

    public void setIsChange_str(String isChange_str) {
        this.isChange_str = isChange_str;
    }

    public Boolean getChange() {
        return isChange;
    }

    public void setChange(Boolean change) {
        isChange = change;
    }

    public String getReserve_str1() {
        return reserve_str1;
    }

    public void setReserve_str1(String reserve_str1) {
        this.reserve_str1 = reserve_str1;
    }

    public String getReserve_str2() {
        return reserve_str2;
    }

    public void setReserve_str2(String reserve_str2) {
        this.reserve_str2 = reserve_str2;
    }

    public String getReserve_str3() {
        return reserve_str3;
    }

    public void setReserve_str3(String reserve_str3) {
        this.reserve_str3 = reserve_str3;
    }

    public boolean isReserve_str4() {
        return reserve_str4;
    }

    public void setReserve_str4(boolean reserve_str4) {
        this.reserve_str4 = reserve_str4;
    }

    public boolean isReserve_str5() {
        return reserve_str5;
    }

    public void setReserve_str5(boolean reserve_str5) {
        this.reserve_str5 = reserve_str5;
    }

    public int getReserve_str6() {
        return reserve_str6;
    }

    public void setReserve_str6(int reserve_str6) {
        this.reserve_str6 = reserve_str6;
    }

    public int getReserve_str7() {
        return reserve_str7;
    }

    public void setReserve_str7(int reserve_str7) {
        this.reserve_str7 = reserve_str7;
    }

    public String getRealVal() {
        return realVal;
    }

    public void setRealVal(String realVal) {
        this.realVal = realVal;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


}